import request from '@/utils/request'

// 查询质检单列表
export function listInvoices(query) {
  return request({
    url: '/quality/receipts/list',
    method: 'get',
    params: query
  })
}

// 查询质检单任务详细
export function getInvoices(id) {
  return request({
    url: '/quality/receipts/' + id,
    method: 'get'
  })
}

// 查询全部质检单任务详细
export function getInvoicesAll(id) {
  return request({
    url: '/quality/detail/listByReceiptsId/' + id,
    method: 'get'
  })
}

// 新增质检单
export function addInvoices(data) {
  return request({
    url: '/quality/receipts',
    method: 'post',
    data: data
  })
}

// 修改质检单任务
export function upDataInvoices(data, type, id) {
  return request({
    url: '/quality/detail/' + type + '/' + id,
    method: 'put',
    data: data
  })
}

// 删除质检单
export function delInvoices(ids) {
  return request({
    url: '/quality/receipts/' + ids,
    method: 'delete'
  })
}

// 导出质检单
export function exportInvoices(query) {
  return request({
    url: '/quality/receipts/export',
    method: 'get',
    params: query
  })
}
